<!doctype html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Logout successful</title>
    <meta name="description" content="" />
    <meta name="keywords" content="logout" />
    <script type="text/javascript">
      function login() {
        window.location.href = window.location.origin;
      }

      function getUrlParameter(name) {
        name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
        var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
        var results = regex.exec(location.search);
        return (results && decodeURIComponent(results[1].replace(/\+/g, ' '))) || '';
      }
    </script>
    <link
      rel="stylesheet"
      type="text/css"
      href="/fundamental-styles/fundamental-styles.css"
    />
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <style>
      .sap-icon--log::before {
        font-size: 150px;
        color: #a0a0a0;
      }
      .fd-container--centered {
        text-align: center;
      }
      a.fd-button {
        color: #fff;
      }
      .fd-page {
        height: 100vh;
      }
      .fd-page__content {
        display: flex;
        align-items: center;
        justify-content: center;
      }
      .fd-has-text-align-center {
        text-align: center;
      }
      .info,
      .hint {
        text-align: center;
        margin: 0;
      }
      .info {
        padding-top: 30px;
        font-size: 36px;
      }
      .hint {
        font-size: 18px;
        color: #6f7275;
        padding-bottom: 30px;
      }
    </style>
  </head>
  <body>
    <div class="fd-ui fd-ui--fundamental">
      <div class="fd-page">
        <div class="fd-page__content">
          <section class="fd-section">
            <div class="fd-has-text-align-center">
              <div class="info" id="headline" data-testid="logout-headline">
                You have successfully logged out.
              </div>
              <div class="hint" id="message" data-testid="logout-message">
                Sign in again to continue working on awesome things!
              </div>
            </div>
            <p class="fd-has-text-align-center">
              <button class="fd-button fd-button--emphasized" onclick="login()">
                Re-Login
              </button>
            </p>
          </section>
        </div>
      </div>
    </div>
    <script type="text/javascript">
      var error = getUrlParameter('error');
      var errorDescription = getUrlParameter('errorDescription');

      switch (error) {
        case 'tokenExpired':
          document.getElementById('headline').innerText = 'Your session has expired.';
          break;
        case 'loginError':
          document.getElementById('headline').innerText = 'Ooops, something went wrong.';
          document.getElementById('message').innerText = 'Please try to log in again.';
          break;
        default:
          break;
      }

      if (errorDescription) {
        document.getElementById('message').innerText = errorDescription;
      }
    </script>
  </body>
</html>
